.class public Lcom/waiqin365/h5/io/WqOpenFile;
.super Lorg/apache/cordova/CordovaPlugin;


# instance fields
.field a:Z

.field private b:Lorg/apache/cordova/WqCordovaActivity;

.field private c:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->a:Z

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/io/WqOpenFile;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->c:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/h5/io/WqOpenFile;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->b:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 4

    const/4 v1, 0x1

    const/4 v3, 0x0

    iput-boolean v3, p0, Lcom/waiqin365/h5/io/WqOpenFile;->a:Z

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->b:Lorg/apache/cordova/WqCordovaActivity;

    if-eqz p2, :cond_1

    invoke-virtual {p2, v3}, Lorg/apache/cordova/CordovaArgs;->isNull(I)Z

    move-result v0

    if-nez v0, :cond_1

    invoke-virtual {p2, v3}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->c:Ljava/lang/String;

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->c:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_2

    iget-boolean v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->a:Z

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->getThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    new-instance v1, Lcom/waiqin365/h5/io/c;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/io/c;-><init>(Lcom/waiqin365/h5/io/WqOpenFile;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    :goto_1
    iget-boolean v0, p0, Lcom/waiqin365/h5/io/WqOpenFile;->a:Z

    if-eqz v0, :cond_0

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v1, "notExist"

    const-string/jumbo v2, "0"

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v0

    invoke-virtual {p3, v0}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONObject;)V

    :cond_0
    return v3

    :cond_1
    iput-boolean v1, p0, Lcom/waiqin365/h5/io/WqOpenFile;->a:Z

    goto :goto_0

    :cond_2
    iput-boolean v1, p0, Lcom/waiqin365/h5/io/WqOpenFile;->a:Z

    goto :goto_1
.end method
